import numpy

def quiet_sqrt(v):
    return numpy.where(v > 0, numpy.sqrt(numpy.fabs(v)), 
                       -numpy.sqrt(numpy.fabs(v)))
